package com.bdqn.controller;


import com.bdqn.entity.PmsProductCategory;
import com.bdqn.entity.util.RespBean;
import com.bdqn.service.PmsProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品分类表 前端控制器
 * </p>
 *
 * @author hunter
 * @since 2022-04-30
 */
@RestController
@RequestMapping("/pms/product/category")
public class PmsProductCategoryController {
    @Autowired
    private PmsProductCategoryService pmsProductCategoryService;

    @GetMapping("/list")
    public RespBean list() {
        //获取列表并返回
        List<PmsProductCategory> pmsProductCategoryList = pmsProductCategoryService.getPmsProductCategoryList();
        if(pmsProductCategoryList.size()>0){
            return  RespBean.ok("获取商品类别信息列表成功",pmsProductCategoryList);
        }else {
            return RespBean.err("获取商品类别信息列表失败");
        }
    }
}
